package com.feeyo.prophet.pojo.vo;

import com.feeyo.prophet.pojo.po.ChatRecord;
import org.springframework.data.annotation.Id;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

public class AnswerVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @Id
    private String id;

    /**
     * 回复的消息ID
     */
    private String lastId;

    /**
     * 对话内容
     */
    private String content;

    /**
     * 聊天内容类型
     */
    private String contentType;

    /**
     * 使用到的 action
     */
    private String actions;

    /**
     * 参数
     */
    private List<String> params;

    /**
     * 对用户是否用, 0:用户未评论. 1:对用户有用. 2:用户无用.
     */
    private Integer usefulness;

    /**
     * 用户反馈
     */
    private String feedback;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLastId() {
        return lastId;
    }

    public void setLastId(String lastId) {
        this.lastId = lastId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getActions() {
        return actions;
    }

    public void setActions(String actions) {
        this.actions = actions;
    }


    public List<String> getParams() {
        return params;
    }

    public void setParams(List<String> params) {
        this.params = params;
    }

    public Integer getUsefulness() {
        return usefulness;
    }

    public void setUsefulness(Integer usefulness) {
        this.usefulness = usefulness;
    }

    public String getFeedback() {
        return feedback;
    }

    public void setFeedback(String feedback) {
        this.feedback = feedback;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }


    public static AnswerVO convert(ChatRecord chatRecord) {
        AnswerVO answerVO = new AnswerVO();
        answerVO.setId(chatRecord.getId());
        answerVO.setLastId(chatRecord.getLastId());
        answerVO.setContent(chatRecord.getContent());
        answerVO.setContentType(chatRecord.getContentType());
        answerVO.setActions(chatRecord.getActions());
        answerVO.setUsefulness(chatRecord.getUsefulness());
        answerVO.setFeedback(chatRecord.getFeedback());
        answerVO.setCreateTime(chatRecord.getCreateTime());
        return answerVO;
    }
}
